package com.zhijiang.common.util;

public class AccessToken {
	private String accessToken;
	private long expiresTime;
	public String getAccessToken() {
		return accessToken;
	}
	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}
	public long getExpireTime() {
		return expiresTime;
	}
	public void setExpireTime(long expireTime) {
		this.expiresTime = expireTime;
	}
	//构造函数，直接计算出过期时间赋给expiresTime
	public AccessToken(String accessToken, String expiresIn) {
		super();
		this.accessToken = accessToken;
		expiresTime = System.currentTimeMillis()+Integer.parseInt(expiresIn)*1000;
	}
	//判断是否过期
	public boolean isExpired() {
		return System.currentTimeMillis()>expiresTime;
	}

}
